<docs>
  ## bar帮助和主页按钮
</docs>
<template>
  <div class="bar" id="bar" v-show="visibleAll">
    <!-- <div class="help item"
      @click="helpTarget"
      v-show="visibleHelp">
      <i class="iconfont icon-info"></i>
    </div> -->
    <div class="prev" @click="goback">
      <img src="../../common/images/return.png" alt="">
    </div>
    <div class="item" @click="goHome">
      <i class="iconfont icon-com_home"></i>
    </div>
  </div>
</template>
<script>

export default {
  name: 'bar',
  computed: {
    visibleAll() {
      return this.$store.getters.visibleAll;
    },
    visibleHelp() {
      return this.$store.getters.visibleHelp;
    }
  },
  methods: {
    helpTarget() {
      const { title, content } = this.$store.getters.help;
      this.$helpInfo({
        title,
        msg: content
      });
    },
    goHome(){
      this.$router.isBack = true;
      this.$router.push({path:'/index'})
    },
    goback(){
      this.$router.go(-1);
    }
  }
};
</script>
<style scoped lang="scss">
  @import '~common/scss/var.scss';
  $padHelp: $padding-base / 3;
  .bar {
    position: fixed;
    bottom: 150px;
    right: 10px;
    color: $color-base;
    z-index: 6;
    .iconfont {
      font-size: $font-size-ultra * 3/4;
      display: block;
      height: 60px;
      width: 60px;
      box-sizing: border-box;
      background: #fff;
      border-radius: 50%;
      position: relative;
      // box-shadow: $color-base 0 0 1px;
    }
    .iconfont:before {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
    .icon-info:before {
      transform: translate(-50%, -47%);
    }
    .item {
      display: block;
      padding: $padding-base / 2;
      border: $padHelp solid #fff;
      background: transparent;
      border-radius: 50%;
      box-shadow: $color-base 0 1px 6px;
      // text-shadow:  $color-base 0 2px 10px;
    }
    .item,
    .item .iconfont {
      transition: $transition;
    }
    .item:active {
      border-color: $color-base;
      .iconfont {
        background-color: $color-base;
        color: #fff;
      }
    }
    .prev{
      width: 90px;
      height: 90px;
      border-radius: 45px;
      text-align: center;
      background-color: #246fde;
      img {
        width: 100%;
        height: 100%;
        border-radius: 45px;
      }
    }
  }
</style>
